package me.buick.util.jmeter.snmpvisualizers;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import me.buick.util.jmeter.snmp.snmpmgmt.SNMPSampleResult;

import org.apache.jmeter.visualizers.MonitorModel;
import me.buick.util.snmp.core.pojo.DiskIOPojo;
import me.buick.util.snmp.core.pojo.DiskUsagePojo;
import me.buick.util.snmp.core.pojo.NetworkInfoPojo;

public class SNMPMonitorModel extends MonitorModel {
	private SNMPSampleResult sample;
	
	public SNMPMonitorModel(SNMPSampleResult sample) {
		this.sample = sample;
	}
	
	public Map<String, DiskIOPojo> getDiskIOs(){
		return this.sample.getDiskPartitionsIO();
	}
	
	public Map<String, NetworkInfoPojo> getNetworkIOs(){
		return this.sample.getNetworkIO();
	}
	
	public int getCpuload() {
		return (int)sample.getCpuLoad();
	}

	public int getMemload() {
		return (int)sample.getMemLoad();
	}
	
	public long getMemUsed() {
		return sample.getMemUsage();
	}
	
	public Map<String, DiskUsagePojo> getDiskUsage() {
		List<Integer> usedResult = new ArrayList<Integer>();
		return  sample.getDiskPartitions();
	}
	
	public long getMemMax() {
		return sample.getMem();
	}
	
	public long getTimestamp() {
		return sample.getTimeStamp();
	}
	
	public String getServerType(){
		return sample.getServerType();
	}
	
	public SNMPSampleResult getOriginalSampleResult(){
		return this.sample;
	}
	
	public Map<String, Double> getCPUDetailed(){
		return this.sample.getProcessorLoad();
	}
	
	public Map<String, NetworkInfoPojo> getNetworkIO(){
		return this.sample.getNetworkIO();
	}
	
	public boolean isLoad() {
		return this.sample.isLoad();
	}
	
}
